<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>注册页面</title>
	</head>
	<body>
		<h2>注册页面</h2>
		姓名：<input type="text" name="username"/><br />
		密码：<input type="password" name="userpswd"/><br />
		性别：<input type="radio" name="sex" value="男" />男<input type="radio" name="sex" value="女" />女<br />
		学院：
		<select name="collge">
			<option value ="">软件工程学院</option>
			<option value ="">城乡建筑学院</option>
			<option value ="">医学护理学院</option>
		</select><br />
		爱好：
		<input type="checkbox" name="like"/>打游戏
		<input type="checkbox" name="like"/>干饭<br />
		自我介绍：
		<textarea rows="8" cols="12" name="zwjs"></textarea><br />
		<button type="button" onclick="aa()">name查找</button>
		<button type="button" onclick="bb()">标签查找</button>
	</body>
	<script type="text/javascript">
		function aa(){
			var n1obj = document.getElementsByName('username');
			console.log(n1obj);
			var n2obj = document.getElementsByName('userpswd');
			console.log(n2obj);
			var n3obj = document.getElementsByName('sex');
			console.log(n3obj);
			var n4obj = document.getElementsByName('collge');
			console.log(n4obj);
			var n5obj = document.getElementsByName('like');
			console.log(n5obj);
			var n6obj = document.getElementsByName('zwjs');
			console.log(n6obj);
		}
		function bb(){
			var b1obj = document.getElementsByTagName('input');
			console.log(b1obj);
			var b2obj = document.getElementsByTagName('select');
			console.log(b2obj);
			var b3obj = document.getElementsByTagName('textarea');
			console.log(b3obj);
		}
	</script>
</html>
